package day12;

public class AccountAdmin {
	private double balance;
	//账号
	private int number;
	public AccountAdmin(int number) {
		this.number = number;
	}
	public void deposit(double amount) {
		balance = balance + amount;
	}
	
	public void withdraw(double amount) throws Yichang02 {
		if(amount <= balance) {
			balance -= amount;
		}else {
			double need = amount - balance;
			throw new Yichang02(need);
		}
	}
	public double getBalance() {
		return balance;
	}
	public void setBalance(double balance) {
		this.balance = balance;
	}
	public int getNumber() {
		return number;
	}
	public void setNumber(int number) {
		this.number = number;
	}
}
